using System;
using System.Globalization;
using Avalonia.Data.Converters;

namespace AvaloniaWeChatList.Convertors;

public sealed class MessageContentWidthConverter : IValueConverter
{
    public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
    {
        if (value is not double width)
            throw new ArgumentNullException("width");

        return width * 0.6;
    }

    public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}